﻿using RecruitmentAgency.Models.DataProviders;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RecruitmentAgency.Models.DataTypes;

namespace RecruitmentAgency.Tests.Models.DataProviders
{
    /// <summary>
    ///This is a test class for JobProviderDataProviderTest and is intended
    ///to contain all JobProviderDataProviderTest Unit Tests
    ///</summary>
    [TestClass]
    public class JobProviderDataProviderTest
    {
        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext { get; set; }
        private JobProviderDataProvider target;

        /// <summary>
        ///Initialises test members
        ///</summary>
        [TestInitialize]
        public void Initialize()
        {
            target = new JobProviderDataProvider();
        }
       
        /// <summary>
        ///A test for GetJobProviderByPersonId
        ///</summary>        
        [TestMethod]
        public void GetJobProviderByPersonIdTest()
        {
            //expected to fail
            JobProviderDataProvider jobProviderDataProvider = new JobProviderDataProvider(); 
            int personId = 2; 
            JobProvider expected = new JobProvider {JobProviderId = 2};
            JobProvider actual = jobProviderDataProvider.GetJobProviderByPersonId(personId);
            Assert.AreNotEqual(expected, actual);           
        }

        /// <summary>
        ///A test for GetJobProvider
        ///</summary>        
        [TestMethod]
        public void GetJobProviderTest()
        {            
            JobProviderDataProvider target = new JobProviderDataProvider(); 
            int jobProviderId = 2; 
            JobProvider expected = new JobProvider
            {
                AddressLine1 = "AddressLine1",
                AddressLine2 = "AddressLine2",
                CompanyName = "CompanyName",
                ConfirmPassword = "Password",
                Email = "email@email.com",
                FirstName = "FirstName",
                LastName = "LastName",
                Password = "Password",
                Phone = "1123123131231",
                PostCode = "Postcode",
                RegistrationNumber = "12321423423423",
                Sector = "IT",
                Title = "Mr",
                Town = "Town",
                UserName = "Username",
                WebsiteUrl = "www.websiteurl.com"
            };
            JobProvider actual = target.GetJobProvider(jobProviderId);
            Assert.AreNotEqual(expected, actual);            
        }        
    }
}